package com.liming.order.client;

import com.liming.common.pojo.dto.order.admin.RefundPageQuery;
import com.liming.common.pojo.vo.PageVO;
import com.liming.common.pojo.vo.order.web.RefundOrderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

/**
 * @author liming
 * @date 2025/4/14
 */
@FeignClient(value = "order-service", contextId = "adminRefundOrderClient", path = "/service/admin-refund-order")
public interface AdminRefundOrderClient {

    /**
     * 退款订单分页
     *
     * @param query 查询参数
     * @return 退款订单分页
     */
    @GetMapping("refund")
    PageVO<RefundOrderVO> refundPage(@SpringQueryMap RefundPageQuery query);

    /**
     * 同意退款 - 订单
     *
     * @param refundOrderId 退款订单id
     * @return 同意退款结果
     */
    @PutMapping("agreeRefund/{id}")
    Boolean agreeRefund(@PathVariable("id") Long refundOrderId);

    /**
     * 拒绝退款 - 订单
     *
     * @param refundOrderId 退款订单id
     * @param reason        拒绝原因
     * @return 拒绝退款结果
     */
    @PutMapping("refuseRefund/{id}")
    Boolean refuseRefund(@PathVariable("id") Long refundOrderId, @RequestParam String reason);

    /**
     * 查询退款 - 订单
     *
     * @param refundOrderId 退款订单id
     * @return 查询退款结果
     */
    @PutMapping("queryRefund/{id}")
    Boolean queryRefund(@PathVariable("id") Long refundOrderId);
}
